<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>星星评分插件-Jquery插件库-林氏智造</title>
		<link href="css/reset.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<link href="css/ui.css" rel="stylesheet" />
		<link href="css/shCoreDefault.css" rel="stylesheet" />
		<script type="text/javascript" src="js/jquery-1.10.0.min.js"></script>
		<script type="text/javascript" src="js/shCore.js"></script>
		<script type="text/javascript" src="js/shBrushCSharp.js"></script>
		<script type="text/javascript">SyntaxHighlighter.all();</script>
		<script type="text/javascript" src="js/lin_star.1.0.js"></script>
		<script type="text/javascript">
			$(function(){
				$("#demo1").lin_star({
			'startGrades':0,
			'clickFunction':function(i){
				$('#serverStar').val(i);
			},
			mouseenterFunction:function(i){
				var str='';
				if(i>=1 && i<=2)
				{
					str='一般';
				}else if(i>2 && i<=4)
				{
					str='良好';
				}else{str='很好';}
				$('#serverTip').html(str);
			}
		});	  
		
			});
		</script>
	</head>
	<body id="main">
		
		<div class="slidebar">
			<a href="http://www.0773linji.com" title="林氏智造" class="logo">林氏智造</a>
			<div class="slidebar_title">Jquery<span class="ver">插件库</span></div>
            <iframe src="../menu.html" frameborder="0"></iframe>
		</div>
		
		<div class="content">
			
			<div class="caption"><h2>星星评分插件</h2><span class="file">Define in : lin_star.1.0.js</span></div>
			
			<div class="mod_desc">
        			<p>监听星星元素的li的鼠标经过事件获取当前经过元素的index,然后用for循环把index前的元素全部加选中状态<br/>
监听星星元素的li的鼠标离开事件获取当前经过元素的index,然后用for循环把index前的元素全部删除选中状态<br/>
监听星星元素的li的鼠标单击事件获取当前经过元素的index,然后用for循环把index前的元素全部删除选中状态,并且返回index+1就是最终打的分数;然后通过修改其父类元素的data_enabled的值使其不能使用<br/>
你也可以通过自定义单击和经过回调函数，来完成你想要的效果！</p>
    			</div>
    			
    			<h3 class="title_lv2">
    				$("<span>type</span>").lin_star([ <em>options</em> ]);
    			</h3>
    			
    			<dl class="deps">
        			<dt>依赖</dt>
        			<dd>JS : jquery-1.10.0.min.js</dd>
        			<dd>浏览器 : ie7+</dd>
    			</dl>
    			
    			<div class="params_box">
				<h5>参数</h5>
				<ul class="params_list">
					<li>
						<dl>
							<dt>target</dt>
							<dd>String</dd>
						</dl>
						<div class="params_desc">
							<span class="type required">必需</span>
							<p>target DOM元素ID或者DOM元素class,对匹配元素进行插件绑定。</p>
						</div>
					</li>
					<li>
						<dl>
							<dt>options</dt>
							<dd>Object</dd>
						</dl>
						<div class="params_desc">
							<span class="type optional">可选</span>
							<p>多选形式的可配置参数。</p>
						</div>
					</li>
				</ul>
			</div>
			
			<div class="article_box">
        			<p>下表列出了options参数介绍。</p>
    			</div>
    			
    			<table class="props_tb">
        <colgroup>
            <col style="width:130px">
            <col style="width:100px">
            <col style="width:70px">
            <col style="width:370px">
        </colgroup>
        <thead>
            <tr class="even">
                <th>参数</th>
                <th>数据类型</th>
                <th>默认值</th>
                <th>说明</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><b class="name">grades</b></td>
                <td><span class="type">int</span></td>
                <td><span class="normal">5</span></td>
                <td class="t_l">
                    <p>总分数</p>
                </td>
            </tr>
            <tr class="even">
                <td><b class="name">startGrades</b></td>
                <td><span class="type">int</span></td>
                <td><span class="normal">0</span></td>
                <td class="t_l">
                    <p>初始分数</p>
                </td>
            </tr>
            <tr>
                <td><b class="name">enabled</b></td>
                <td><span class="type">int</span></td>
                <td><span class="normal">1</span></td>
                <td class="t_l">
                    <p>是否可以打分</p>
                </td>
            </tr>
            <tr class="even">
                <td><b class="name">starClass</b></td>
                <td><span class="type">String</span></td>
                <td><span class="normal">lin_star</span></td>
                <td class="t_l">
                    <p>星星列表样式</p>
                </td>
            </tr>
            <tr>
                <td><b class="name">currentStarClass</b></td>
                <td><span class="type">String</span></td>
                <td><span class="normal">current</span></td>
                <td class="t_l">
                    <p>星星选中样式</p>
                </td>
            </tr>
            <tr class="even">
                <td><b class="name">starChild</b></td>
                <td><span class="type">String</span></td>
                <td><span class="normal">li</span></td>
                <td class="t_l">
                    <p>星星HTML元素</p>
                </td>
            </tr>
            <tr>
                <td><b class="name">clickFunction</b></td>
                <td><span class="type">Function</span></td>
                <td><span class="normal">''</span></td>
                <td class="t_l">
                    <p>单击回调事件function(i){}</p>
                    <p><b>i</b> 当前分数</p>
                </td>
            </tr>
            <tr class="even">
                <td><b class="name">mouseenterFunction</b></td>
                <td><span class="type">Function</span></td>
                <td><span class="normal">''</span></td>
                <td class="t_l">
                    <p>经过星星回调函数function(i){}</p>
                    <p><b>i</b> 当前分数</p>
                </td>
            </tr>
            <tr>
                <td><b class="name">mouseleaveFunction</b></td>
                <td><span class="type">Function</span></td>
                <td><span class="normal">''</span></td>
                <td class="t_l">
                    <p>离开星星回调函数function(i){}</p>
                    <p><b>i</b> 当前分数</p>
                </td>
            </tr>
       
        </tbody>
    </table>
    
    
    <div class="example_box">
        <h5>例子一：基本调用</h5>
        <p>CSS</p>    
        <div class="code_box">
        		<pre class="brush: csharp;">.lin_star{height:32px;}
.lin_star li{background: url(star.png) 0px 0px  no-repeat; width:32px; height:32px; float:left; display:inline; margin-right:5px;}
.lin_star li.current{background-position:0px -32px;}</pre>
        </div>
		<p>JS</p>    
        <div class="code_box">
        		<pre class="brush: csharp;">$("#demo1").lin_star({
			'startGrades':0,
			'clickFunction':function(i){
				$('#serverStar').val(i);
			},
			mouseenterFunction:function(i){
				var str='';
				if(i>=1 && i<=2)
				{
					str='一般';
				}else if(i>2 && i<=4)
				{
					str='良好';
				}else{str='很好';}
				$('#serverTip').html(str);
			}
		});	  
		</pre>
        </div>        
        
        <div class="demo_box">
            
           <div id="demo1"></div>
           <div>服务Tip:<span id="serverTip"></span>&nbsp;&nbsp;服务分数：<input type="text"  id="serverStar"/></div>
		
            
        </div>
        
    </div>
    
   
    
    
    <div class="download">
        <h3>立即下载</h3>
        <div class="download_box">
            <a href="#" target="_blank" class="btn_download btn_download_wide">
                <span class="icon_box"><s class="icon_download"></s></span>
                <span class="title">lin_star</span>
                <span class="version">version : 1.0</span>
            </a>
        </div>
    </div>
    
    <div class="download">
        <h3>联系我</h3>
        <div class="download_box">
           <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=317365887&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:317365887:53" alt="请注明通过林氏智造发现此QQ" title="请注明通过林氏智造发现此QQ"/></a>
        </div>
    </div>
			
			
		</div>
		
	</body>
</html>
